home *** CD-ROM | disk | FTP | other *** search
/ develop, the CD; issue 1 / Apple_Develop_1989.bin / Declaration ROM / ExROM1Fun.a next >
Text File  |  1989-09-15  |  11KB  |  282 lines

  1. ;---------------------------------------------------------------------------------------
  2. ;
  3. ;File:          ExROM1Fun.a
  4. ;Dev system:    MPW 3.0
  5. ;By:            MacDTS
  6. ;Date:            8/08/89
  7. ;
  8. ; This is a very small sample declaration ROM with the required board 
  9. ; sResource and a functional sResource (which is blank).
  10. ; The board id and functional sResource types are especially bogus - your values
  11. ; must be obtained from MacDTS, after sending in the required information.
  12. ; Anyway, this file shows how to put together a ROM.  You also need
  13. ; the Cards and Drivers book, with the source code for a ROM and driver.
  14. ; Both are stripped down versions of the Apple Macintosh Video card ROM and
  15. ; video driver aka the TFB board.  There are also other examples and exploded
  16. ; drawings of declaration ROMs on the Developer Helper CD. Volume one is 
  17. ; known as "Phil and Dave's Excellent CD".  The examples, tools, and drawings are 
  18. ; also on AppleLink.  To get to them, go into (in order):
  19. ;
  20. ;  Developer Services bulletin board icon
  21. ;     Developer Technical Support folder 
  22. ;        Macintosh folder 
  23. ;           Tools folder
  24. ;             Card Dev tools folder
  25. ;
  26. ;
  27. ; In the Card Dev Tools folder are other folders containing tools and 
  28. ; libraries.  These include:
  29. ;
  30. ; Examples folder            - contains example declaration ROMs, video driver, 
  31. ;                              source to a program like the GetsInfo program found
  32. ;                              in the Slot Tools folder
  33. ; Gamma Information folder    - contains documention discussing gamma table format. 
  34. ;                              This will be updated in later documentation for the 
  35. ;                              new 32-bit QuickDraw.  Eventually, the Cards and 
  36. ;                              Drivers book will contain the new gamma information, 
  37. ; NuBusTester folder        - contains a library to detect new ROMs with fixed 
  38. ;                              Slot Manager (Slot Manager that runs in 32-bit mode
  39. ;                              as opposed to 24-bit mode)
  40. ; Training Tools folder        - contains MacDraw drawings of exploded
  41. ;                              configuration ROMs (like the existing Apple video
  42. ;                              card ROM and the Apple EtherNet board ROM.
  43. ;                           
  44. ; Slot tools folder            - Inside, you'll find these tools:
  45. ;
  46. ;                              CRCPatch - MPW tool that calculates and patches in 
  47. ;                              the crc value of the assembled Declaration ROM file.
  48. ;
  49. ;                              Data - MPW tool takes the assembled file and strips 
  50. ;                              off the code 0 segment,leaving the code 1 segment 
  51. ;                              (the raw code).  The resulting file can then be 
  52. ;                              downloaded to a rom burning machine. 
  53. ;                            
  54. ;                              Tjscomm - A small terminal program that can be used
  55. ;                              to download the data file to a rom burning machine.
  56. ;                            
  57. ;                              SlotMgrTst - application that excersises the slot 
  58. ;                              manager by making slot manager calls
  59. ;                            
  60. ;                              GetsInfo - application that displays sResources and
  61. ;                              other configuration ROM information
  62. ;
  63. ; Disclaimer: the above may be reorganized at any time, or changed via additions 
  64. ; and deletions.
  65. ;
  66. ;
  67. ;  The general structure of this example ROM is:
  68. ;
  69. ;                        [Format/Header]
  70. ;                                |
  71. ;                                |
  72. ;                      [sResource Directory]
  73. ;                            /        \
  74. ;                           /         \
  75. ;                          /              \
  76. ;                         /               \
  77. ;            [Board sResource]        [Functional sResource]
  78. ;                - Primary Init.            - Driver Directory.
  79. ;                - board id
  80. ;                - Vendor Info.            
  81. ;
  82. ;
  83. ;  If you want to print this, I suggest using landscape mode!!!
  84. ;
  85. ;-------------------------------------------------------------------
  86.  
  87.             MACHINE        MC68020
  88.  
  89. ;=====================================================================
  90. ;    Initial Assembler Directives
  91. ;=====================================================================
  92.                 PRINT    OFF
  93.                 STRING     C
  94.                                                     ;Note - File names changed
  95.                                                     ;since example in C & D 
  96.                                                     ;book was published.
  97.                 INCLUDE    'SysErr.a'                    ;Macintosh error equates
  98.                 INCLUDE    'SysEqu.a'                    ;Macintosh System equates
  99.                 INCLUDE    'ROMEqu.a'                    ;Declaration ROM equates
  100.                 INCLUDE    'SlotEqu.a'                    ;Slot Manager equates and macros
  101.                 INCLUDE    'TimeEqu.a'                    ;Macintosh traps
  102.                 INCLUDE    'Traps.a'                    ;Macintosh traps
  103.                 PRINT    ON
  104.  
  105. ;=====================================================================
  106. ;    BEGIN Declaration ROM
  107. ;=====================================================================
  108. SampleDeclROM    MAIN
  109.  
  110.                 
  111.  
  112. ;*************************************************************
  113. ;        Constants
  114. ;*************************************************************
  115.   
  116. ROMSize            EQU        $1000                        ;4K byte ROM in this example
  117. TheBoardId        EQU        $ABCD                        ;the Board Id (DON'T USE
  118.                                                     ; THIS-GET from DTS!)
  119.  
  120.                                                     ;board sResource equates
  121.                                                     ;the following two lines are 
  122. ;catBoard        EQU         1                        ;commented out since the equates
  123. ;TypeBoard        EQU         0                        ;are already defined in ROMEqu.a
  124. DrSwBoard        EQU         0                        ;NOT in ROMEqu.a, define it here
  125. DrHwBoard        EQU         0                        ;NOT in ROMEqu.a, define it here
  126.  
  127. CatExCat        EQU         $6666                    ;Functional sResource sRsrc_Type
  128. TypExTyp        EQU         $7777                    ;equates. THESE ARE EXAMPLES
  129. DrSwExSw        EQU         $8888                    ;ONLY!  DON'T USE THESE VALUES
  130. DrHwExHw        EQU         $9999                    ;GET THEM FROM DTS!!
  131.  
  132.                                                     ;Example values-vendors
  133.                                                     ;should modify as needed
  134. defMinorBase    EQU    0                                ;RAM Offset is 0
  135. defMinorLength    EQU    $40000                            ;RAM length is $40000
  136.  
  137. ;-----------  sResource Directory                    ;<Id OF>
  138. sRsrcBoard        EQU        1                            ;Board sResource {May be any 
  139.                                                     ;number in [0..127]}
  140. sRsrcFun        EQU        128                            ;functional sResource {May be 
  141.                                                     ;any number in [128..254]}
  142.  
  143.                                                             
  144. ;=====================================================================
  145. ;        Directory 
  146. ;=====================================================================
  147. _sRsrcDir        OSLstEntry    sRsrcBoard,_sRsrcBoard    ;References board sResource.
  148.                 OSLstEntry    sRsrcFun,_sRsrcFun        ;References functional sResource.
  149.                 DatLstEntry    endOfList,0                ;End of the list.
  150.  
  151.                                                             
  152. ;=============================================================
  153. ;            The Board sResource
  154. ;=============================================================
  155. _sRsrcBoard        OSLstEntry    sRsrcType,_BoardType    ;References Rsrc_Type entry
  156.                 OSLstEntry    sRsrcName,_BoardName    ;References Rsrc_Name entry
  157.                 DatLstEntry    boardId,TheBoardId        ;boardId  **ASSIGNED BY MACDTS**
  158.                 OSLstEntry    primaryInit,_sPInitRec    ;References Primary init record.
  159.                 OSLstEntry    vendorInfo,_VendorInfo    ;References Vendor info list.
  160.                 DatLstEntry    endOfList,0                ;End of the list.
  161.  
  162.                                                     ;Rsrc_Type IS ALWAYS THE SAME
  163.                                                     ;for the board sResource 
  164.                                                     ;(but varies with different
  165.                                                     ;functional sResources)
  166. _BoardType        DC.W    CatBoard                    ;ALWAYS $0001 for bd sResource 
  167.                 DC.W    TypBoard                    ;ALWAYS $0000 for bd sResource
  168.                 DC.W    DrSwBoard                    ;ALWAYS $0000 for bd sResource
  169.                 DC.W    DrHwBoard                    ;ALWAYS $0000 for bd sResource
  170. _BoardName        DC.L    'OFFICIAL PRODUCT NAME'        ;The name of the Board - should 
  171.                                                     ;be official product name
  172.  
  173.                                                             
  174. ;-------------------------------------------------------------
  175. ;            Primary Init Record (if needed)
  176. ;-------------------------------------------------------------
  177. _sPInitRec        DC.L    _EndsPInitRec-_sPInitRec    ;physical Block Size
  178. ;                INCLUDE    'PrimaryInit.a'                ;Primary Init Code
  179. _EndsPInitRec    EQU        *                            ;End of block
  180.                 STRING     C                            ;Restore to 'c' string type.
  181.  
  182.                                                             
  183. ;-------------------------------------------------------------
  184. ;            Vendor Information record
  185. ;-------------------------------------------------------------
  186.                                                     ;** THE VENDOR INFO ENTRIES
  187.                                                     ;ARE DEFINED BY THE VENDOR, NOT
  188.                                                     ;BY MACDTS **
  189. _VendorInfo        OSLstEntry    VendorId,_VendorId        ;References the Vendor Id. 
  190.                 OSLstEntry    RevLevel,_RevLevel        ;References the Revision Level.
  191.                 OSLstEntry    PartNum,_PartNum        ;References the Part Number.
  192.                 DatLstEntry    endOfList,0                ;End of the list.
  193.  
  194. _VendorId        DC.L    'COMPANY NAME'                 ;The Vendor Id.  Most vendors use
  195.                                                     ;company name
  196. _RevLevel        DC.L    'Release-1.0'                ;The Revision Level
  197. _PartNum        DC.L    '12-3456'                    ;The Part Number
  198.  
  199.                                                             
  200. ;=============================================================
  201. ;            The Functional sResource
  202. ;=============================================================
  203. _sRsrcFun        OSLstEn